﻿<sap:ActivityDesigner x:Class="BioWF.Activities.Design.AlignSequencePairDesigner"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:sap="clr-namespace:System.Activities.Presentation;assembly=System.Activities.Presentation"
    xmlns:sapv="clr-namespace:System.Activities.Presentation.View;assembly=System.Activities.Presentation"
    xmlns:bio="clr-namespace:Bio;assembly=Bio"
    xmlns:converters="clr-namespace:System.Activities.Presentation.Converters;assembly=System.Activities.Presentation"
    xmlns:system="clr-namespace:System;assembly=mscorlib"
    xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
    xmlns:interactivity="http://www.julmar.com/wpfhelpers">
    <sap:ActivityDesigner.Icon>
        <DrawingBrush>
            <DrawingBrush.Drawing>
                <ImageDrawing>
                    <ImageDrawing.Rect>
                        <Rect Location="0,0" Size="16,16" ></Rect>
                    </ImageDrawing.Rect>
                    <ImageDrawing.ImageSource>
                        <BitmapImage UriSource="Images/pair_align.png" />
                    </ImageDrawing.ImageSource>
                </ImageDrawing>
            </DrawingBrush.Drawing>
        </DrawingBrush>
    </sap:ActivityDesigner.Icon>

    <StackPanel>
        <StackPanel.Resources>
            <converters:ArgumentToExpressionConverter x:Key="argToExpression" />
            <Style TargetType="TextBlock">
                <Setter Property="FontWeight" Value="Bold" />
                <Setter Property="Margin" Value="5" />
                <Setter Property="VerticalAlignment" Value="Center" />
            </Style>
        </StackPanel.Resources>

        <TextBlock Text="First Sequence" />
        <sapv:ExpressionTextBox Margin="5"
                                ExpressionType="bio:ISequence"
                                OwnerActivity="{Binding ModelItem}"
                                Expression="{Binding ModelItem.FirstSequence, Mode=TwoWay, Converter={StaticResource argToExpression}}"
                                HintText="First Sequence to align"/>

        <TextBlock Text="Second Sequence" />
        <sapv:ExpressionTextBox Margin="5"
                                ExpressionType="bio:ISequence"
                                OwnerActivity="{Binding ModelItem}"
                                Expression="{Binding ModelItem.SecondSequence, Mode=TwoWay, Converter={StaticResource argToExpression}}"
                                HintText="Second Sequence to align"/>

        <TextBlock Text="Sequence Aligner" />
        <ComboBox x:Name="cbAligners" Margin="5"
                  SelectedItem="{Binding ModelItem.AlignerName, Mode=TwoWay}" />

        <TextBlock Text="Similarity Matrix" />
        <ComboBox x:Name="cbMatrices" Margin="5"
                  SelectedItem="{Binding ModelItem.SimilarityMatrix, Mode=TwoWay}"/>

        <TextBlock Text="Gap Open Cost" />
        <TextBox Margin="5" Text="{Binding ModelItem.GapOpenCost, Mode=TwoWay}">
            <i:Interaction.Behaviors>
                <interactivity:NumericTextBoxBehavior Minimum="-200" Maximum="200" />
            </i:Interaction.Behaviors>                
        </TextBox>

        <TextBlock Text="Gap Extension Cost (zero to ignore)" />
        <TextBox Margin="5" Text="{Binding ModelItem.GapExtensionCost, Mode=TwoWay}">
            <i:Interaction.Behaviors>
                <interactivity:NumericTextBoxBehavior Minimum="-200" Maximum="200" />
            </i:Interaction.Behaviors>
        </TextBox>

    </StackPanel>
</sap:ActivityDesigner>
